<template>
  <div class="user-index-card-box">
    <medicalCard v-for="item in medicalInfo" :key="item.id" :medicalInfo="item"></medicalCard>
  </div>
</template>

<script>
/**
 * @author zhaojiuyi
 * @date 2022/9/20-15:41
 * @version 1.0.0
 */
import medicalCard from '@/components/common/medicalCard'

export default {
  components:{medicalCard},
  computed:{
    medicalInfo(){
      const data = this.$store.state.userModules.medicalRecords
      return data.map(item => {
        return {
          id: item.id,
          paramA: item.hospitalName,
          paramB: item.doctorName,
          outline: item.mainSuit,
          time: item.recordTime,
        }
      })
    }
  },
  async mounted() {
    await this.$store.dispatch("getMedicalRecord")
  }
  // data(){
  //   return {
  //     medicalInfo: {
  //       paramA: '花溪大学城医院',
  //       paramB: "张万森",
  //       outline: "腹泻，腹泻还是腹泻",
  //       time: "2022-09-01",
  //     }
  //   }
  // }
}
</script>
